let express = require("express")
let app = express()

app.set("view engine", "ejs")
app.set("views", "./views")

app.get("/", (req, resp) => {
    let data = [{name: "aa", age: 11},{name: "bb", age: 12},{name: "cc", age: 13},{name: "dd", age: 14}]
    resp.render('demo', {data})
})

app.listen(3000, (err) => {
    if(!err){
        console.log("服务器启动成功")
    }else{
        console.log(err)
    }
})